<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link
      href="https://fonts.googleapis.com/css2?family=Paytone+One&amp;display=swap"
      rel="stylesheet"
    />

    <title>You are offline</title>

    <!-- Inline the page's stylesheet. -->
    <style>
      * {
        box-sizing: border-box;
      }
      html,
      body {
        height: 100vh;
        width: 100vw;
        margin: 0;
        background-image: url("");
        background-size: 168px;
        image-rendering: pixelated;
        font-family: Basic, sans-serif;
        overflow: hidden;
        color: white;
        font-size: 22px;
        letter-spacing: -0.4px;
        word-spacing: 3px;
        line-height: 20px;
        background-color: #000000;
      }

      .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        align-items: center;
        height: 100%;
        width: 100%;
        padding: 8px;
      }

      .logo {
        max-width: 90%;
        width: auto;
        margin-bottom: 20px;
      }

      span {
        text-shadow: 1px 1px #1f1f1f;
      }

      .outer-panel {
        display: flex;
        background-color: rgb(185 111 80);
        border-image: url("")
          20% / 1 / 0 stretch;
        border-style: solid;
        border-width: 5.25px;
        image-rendering: pixelated;
        border-radius: 13.125px;
        padding: 2.625px;
        width: 100%;
        max-width: fit-content;

        @media screen and (min-width: 768px) {
          width: 50%;
        }
      }

      .inner-panel {
        background-color: rgb(194 134 105);
        border-image: url("")
          20% / 1 / 0 stretch;
        border-style: solid;
        border-width: 5.25px;
        image-rendering: pixelated;
        border-radius: 13.125px;
        padding: 2.625px;
        display: flex;
        align-items: center;
        flex-direction: column;
      }

      .panel-content {
        display: flex;
        flex-direction: column;
      }

      .connection-message {
        padding: 8px 8px 0 8px;
        margin-bottom: 12px;
        display: flex;
        flex-direction: column;
      }

      .refresh-button {
        border-image-slice: "20%";
        border-image-repeat: "stretch";
        background-color: rgb(231 168 115);
        border-image: url("")
          20% / 1 / 0 stretch;
        border-style: solid;
        border-width: 5.25px;
        image-rendering: pixelated;
        border-radius: 13.125px;
        padding: 2.625px;
        padding-bottom: 8px;
        width: 100%;
        font-family: Basic, sans-serif;
        overflow: hidden;
        color: white;
        font-size: 22px;
        letter-spacing: -0.4px;
        word-spacing: 3px;
        line-height: 20px;
        text-shadow: 1px 1px #1f1f1f;
        cursor: pointer;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <img
        class="logo"
        src=""
        alt="Sunflower Land Logo"
      />
      <div class="outer-panel">
        <div class="inner-panel">
          <div class="panel-content">
            <div class="connection-message">
              <span style="margin-bottom: 6px"
                >Oh no, it looks like your device is currently offline.</span
              >
              <span>
                We will return to your farm once network connection is restored
                or you can try again by refreshing the app.
              </span>
            </div>
          </div>
          <button class="refresh-button" onclick="window.location.reload(true)">
            Refresh
          </button>
        </div>
      </div>
    </div>

    <!-- Inline the page's JavaScript file. -->
    <script>
      // Listen to changes in the network state, reload when online.
      // This handles the case when the device is completely offline.
      window.addEventListener("online", () => {
        window.location.reload();
      });
    </script>
  </body>
</html>
